package com.android.lovely.api.service

import com.android.lovely.api.ApiResp
import com.android.lovely.api.manager.HttpManager
import com.android.lovely.data.Bot
import com.android.lovely.data.BotWrapperData
import com.android.lovely.data.CardDetailBean
import com.android.lovely.data.HomeListData
import com.android.lovely.data.HomeTabData
import com.android.lovely.data.HistoryChat
import com.android.lovely.room.chat.database.CacheMessage
import retrofit2.http.Body
import retrofit2.http.POST

val botService = HttpManager.createApi<BotService>()

interface BotService {

//    @POST("bot/list")
//    suspend fun getBotList(
//        @Body params: Map<String, Int?>
//    ): Map<String, List<Robot>>

    @POST("bot/get_class_bot_list")
    suspend fun getHomeList(@Body params: Map<String, Int?>): Map<String, List<HomeListData>>


    @POST("bot/cards")
    suspend fun getBotCards(@Body params: Map<String, Int>): BotWrapperData

        @POST("bot/buy_card")
    suspend fun buyCard(@Body param: Map<String, Int>): ApiResp<Map<String, Int>>

    @POST("bot/buy_all_card")
    suspend fun unloadAll(@Body params: Map<String, Int>): Map<String, Int>

    @POST("bot/del_one")
    suspend fun deleteChat(@Body params: Map<String, Int>): Any
//
    @POST("bot/detail")
    suspend fun requestBotDetail(@Body params: Map<String, Int>): Bot

    @POST("bot/enter")
    suspend fun enter(@Body params: Map<String, Int>): Map<String, Int>

    @POST("bot/del_all_chat")
    suspend fun reset(@Body params: Map<String, Int>): Any

    @POST("bot/get_chat_image")
    suspend fun getChatImage(@Body params: Map<String, Int>): CacheMessage

    @POST("bot/del_one_chat")
    suspend fun deleteMessage(@Body params: Map<String, Int>): Any

    @POST("bot/last_chat")
    suspend fun getLast(@Body params: Map<String, Int>): HistoryChat

    @POST("bot/update_card")
    suspend fun updateChatBg(@Body params: Map<String, Int>): Any
    @POST("bot/search")
    suspend fun search(
        @Body params: Map<String, @JvmSuppressWildcards Any>): Map<String, List<HomeListData>>

    @POST("bot/hot_search")
    suspend fun hotSearch(): Map<String, List<String>>

    @POST("bot/role_class")
    suspend fun getHomeTabs(@Body params: Map<String, Int> = mapOf()): List<HomeTabData>

    @POST("bot/all_card_price")
    suspend fun getRoleCardInfo(@Body params: Map<String, Int>): CardDetailBean

    @POST("u/del_user_card")
    suspend fun deleteMyCard(@Body params: Map<String, Int>): Any
}